package Game;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;


public class Path implements Entity {

	private int x;
	private int y;
	private Path nextPath;
	private Image graphic;
	private int angleToNext;
	
	public Path(int x, int y, int angle) throws SlickException{	
		graphic = new Image("/data/black.png");
		this.x = x;
		this.y = y;
		angleToNext= angle;
	}

	public int getX(){return x;}
	public int getY(){return y;}
	public Path getNext(){return nextPath;}
	public int getAngle(){return angleToNext;}
	
	/**
	 * Set a new graphic for the road.
	 * @param imageLocation
	 * @throws SlickException
	 */
	public void setGraphic(String imageLocation) throws SlickException{
		graphic = new Image(imageLocation);
	}
	
	/**
	 * Set the next path to go to.
	 * @param next
	 */
	public void setNextPath(Path next){
		nextPath = next;
	}
	
	@Override
	public void draw() {
		graphic.draw(x*Map.TILESIZE, y*Map.TILESIZE);
	}
	
	public String toString(){
		return "(" + x + "," + y + ")";
		
	}
}
